﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Login.ascx.cs" Inherits="Team4Mock.UserControl.AddAccount.Login" %>
<style type="text/css">
    .style1
    {
        width: 159px;
    }
    .button
    {
        height: 26px;
    }
</style>
<script type="text/javascript">
    function Rediect() {
        alert("You do not have permission to on this page");
        window.location.href = "/FormView/Default.aspx";
    }
</script>
<asp:GridView ID="gvAcc" AutoGenerateColumns="False" DataKeyNames="UserID" runat="server"
    Width="725px" Font-Size="15px" BackColor="White" BorderColor="#CCCCCC" AllowSorting="true"
    BorderStyle="None" BorderWidth="1px" CellPadding="3" EmptyDataText="No Record!">
    <Columns>
        <asp:TemplateField HeaderText="ID" Visible="false">
            <ItemTemplate>
                <asp:Label ID="lbID" runat="server" Text='<%#Eval("UserID") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Account">
            <ItemTemplate>
                <asp:HyperLink ID="OrgName" runat="server" NavigateUrl='<%#"/FormView/Signup.aspx?"+"ID="+Eval("UserID") %>'
                    Text='<%#Eval("Account") %>'></asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Email">
            <ItemTemplate>
                <asp:Label ID="lbHOA" runat="server" Text='<%#Eval("Email") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Role">
            <ItemTemplate>
                <asp:Label ID="lbContact" runat="server" Text='<%#Eval("RoleOfUser") %>'></asp:Label>
            </ItemTemplate>
            <ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="White" ForeColor="#000066" />
    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
    <RowStyle ForeColor="#000066" />
    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<asp:Panel runat="server" ID="pnCreate">
    <div style="margin-left: 20px;">
        <h3>
            Create Account</h3>
        <table>
            <tr>
                <td class="style1">
                    User name <span style="color: red;">(*)</span>
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtUser" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Password <span style="color: red;">(*)</span>
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtPass" Width="200px" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Retype password <span style="color: red;">(*)</span>
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtPass2" Width="200px" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Email <span style="color: red;">(*)</span>
                </td>
                <td>
                    <asp:TextBox runat="server" Width="200px" ID="txtEmail"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Question <span style="color: red;">(*)</span>
                </td>
                <td>
                    <asp:DropDownList runat="server" ID="dlQuestion" Width="200px">
                        <asp:ListItem Value="0">Select One</asp:ListItem>
                        <asp:ListItem Value="1">Mother's Birthplace</asp:ListItem>
                        <asp:ListItem Value="2">Best childhood friend</asp:ListItem>
                        <asp:ListItem Value="3">Name of first pet</asp:ListItem>
                        <asp:ListItem Value="4">Favorite teacher</asp:ListItem>
                        <asp:ListItem Value="5">Favorite historial person</asp:ListItem>
                        <asp:ListItem Value="6">Grandfather's occupation</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Secret answer <span style="color: red;">(*)</span>
                </td>
                <td>
                    <asp:TextBox runat="server" Width="200px" ID="txtAnswer"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Verification <span style="color: red;">(*)</span>
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtCapcha" Height="25px" Width="93px"></asp:TextBox>
                    <img id="imgCode" src="/FormView/Capcha.aspx" alt="" align="top" />
                </td>
            </tr>
            <tr>
                <td class="style1">
                    Role
                </td>
                <td>
                    <asp:RadioButton runat="server" ID="rdAdmin" GroupName="role" Text="Admin" />
                    <asp:RadioButton runat="server" ID="rdUser" Checked="true" GroupName="role" Text="User" />
                </td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;
                </td>
                <td>
                    <asp:Button runat="server" ID="btnCreate" Text="Create" CssClass="button" Width="87px"
                        OnClick="btnCreate_Click" />
                    &nbsp;&nbsp;
                    <asp:Button runat="server" ID="btnCancel" Text="Cancel" CssClass="button" Width="81px"
                        OnClick="btnCancel_Click" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Label runat="server" ID="tb"></asp:Label><br />
                    <asp:CompareValidator runat="server" ID="cpPassword" ControlToValidate="txtPass"
                        ControlToCompare="txtPass2" ErrorMessage="Password not match"></asp:CompareValidator><br />
                    <asp:RegularExpressionValidator ID="validateEmail" runat="server" ErrorMessage="Invalid email."
                        ControlToValidate="txtEmail" ValidationExpression="^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$" />
                </td>
            </tr>
        </table>
    </div>
</asp:Panel>
<asp:Panel runat="server" ID="pnAmend">
    <h3>
        Amend Account</h3>
    <table>
        <tr>
            <td class="style1">
                User name <span style="color: red;">(*)</span>
            </td>
            <td>
                <asp:TextBox runat="server" ReadOnly="true" ID="TextBox1" Width="200px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Email <span style="color: red;">(*)</span>
            </td>
            <td>
                <asp:TextBox runat="server" Width="200px" ReadOnly="true" ID="TextBox2"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                Role
            </td>
            <td>
                <asp:RadioButton runat="server" ID="rAdmin" GroupName="role" Text="Admin" />
                <asp:RadioButton runat="server" ID="rUser" GroupName="role" Text="User" />
            </td>
        </tr>
        <tr>
            <td class="style1">
                &nbsp;
            </td>
            <td>
                <asp:Button runat="server" ID="btnUpdate" Text="Update" CssClass="button" Width="87px"
                    OnClick="btnUpdate_Click" />
                &nbsp;&nbsp;
                <asp:Button runat="server" ID="Button2" Text="Cancel" CssClass="button" Width="81px"
                    OnClick="btnCancel_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Label runat="server" ID="lb"></asp:Label>
            </td>
        </tr>
</asp:Panel>
